function makeFeatured(e){$.ajaxSetup({headers:{"X-CSRF-TOKEN":$('meta[name="csrf-token"]').attr("content")}}),$(this),$.ajax({url:APP_URL+"/admin/post/update/featured",type:"POST",dataType:"json",data:{item_id:e,_token:$('meta[name="csrf-token"]').attr("content")},success:function(t){1==t.bool?$("#featured-post-"+e).removeClass("btn-light").addClass("bg-lime-lt").text("Yes"):0==t.bool&&$("#featured-post-"+e).removeClass("bg-lime-lt").addClass("btn-light").text("No")}})};function updateStatusPost(e){$.ajaxSetup({headers:{"X-CSRF-TOKEN":$('meta[name="csrf-token"]').attr("content")}}),$(this),$.ajax({url:APP_URL+"/admin/post/update/status",type:"POST",dataType:"json",data:{item_id:e,_token:$('meta[name="csrf-token"]').attr("content")},success:function(t){1==t.bool?$("#status-post-"+e).removeClass("btn-danger").addClass("bg-lime-lt").text("Active"):0==t.bool&&$("#status-post-"+e).removeClass("bg-lime-lt").addClass("btn-danger").text("Disabled")}})};function savePost(t){$.ajaxSetup({headers:{"X-CSRF-TOKEN":$('meta[name="csrf-token"]').attr("content")}});$(this);$.ajax({url:APP_URL+"/save_favorite",type:"POST",dataType:"json",data:{item:t,_token:$('meta[name="csrf-token"]').attr("content")},success:function(e){1==e.bool?$("#save-icon-"+t).removeClass("text-muted").addClass("icon-filled"):0==e.bool&&$("#save-icon-"+t).removeClass("icon-filled").addClass("text-muted")},error:function(e){location.replace(APP_URL+"/login")} })}function markAsRead(){$.ajaxSetup({headers:{"X-CSRF-TOKEN":$('meta[name="csrf-token"]').attr("content")}});$(this);$.ajax({url:APP_URL+"/mark-as-read",type:"post",dataType:"json",data:{_token:$('meta[name="csrf-token"]').attr("content")},success:function(t){1==t.bool&&$("#notify").css("display","none")}})}function deleteComment(t){$.ajaxSetup({headers:{"X-CSRF-TOKEN":$('meta[name="csrf-token"]').attr("content")}}),$.ajax({url:APP_URL+"/delete/comment",type:"post",dataType:"json",data:{comment:t,_token:$('meta[name="csrf-token"]').attr("content")},success:function(e){1==e.bool&&$("#comment-"+t).css("display","none")}})}function likePost(a){$.ajaxSetup({headers:{"X-CSRF-TOKEN":$('meta[name="csrf-token"]').attr("content")}});$(this);$.ajax({url:APP_URL+"/save_like",type:"POST",dataType:"json",data:{item:a,_token:$('meta[name="csrf-token"]').attr("content")},success:function(e){var t;1==e.bool?($("#like-icon-"+a).removeClass("text-muted").addClass("icon-filled text-danger"),t=$("#like-"+a).text(),$("#like-"+a).text(++t)):0==e.bool&&($("#like-icon-"+a).removeClass("icon-filled text-danger").addClass("text-muted"),t=$("#like-"+a).text(),$("#like-"+a).text(--t))},error:function(e){location.replace(APP_URL+"/login")}})};